home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4005 < prev    next >
Encoding:
Text File  |  1996-08-05  |  819 b   |  36 lines

  1. Path: news.bellglobal.com!stupy
  2. From: stupy@freenet.durham.org (Steve Tupy)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: strings
  5. Date: 29 Jan 1996 15:00:52 GMT
  6. Organization: Durham Free-Net
  7. Message-ID: <4einf4$330@news.bellglobal.com>
  8. References: <4eg9qj$1ut4@sp115.ocs.lsu.edu>
  9. NNTP-Posting-Host: 204.101.165.17
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Pradeep Nayar (eenaya@unix1.sncc.lsu.edu) wrote:
  13. : Hi,
  14. : I saw this piece of code in a book somewhere.  
  15.  
  16. : ----
  17. : char *str ;
  18.  
  19. : str = "hello world"[10] ;
  20.  
  21. : _________
  22.  
  23. : what does the second line do?
  24.  
  25.  
  26. I don't know how you can get this to compile at all! Now if you had this...
  27.  
  28. char *str = "hello world"; or even
  29. char *str = { "hello world" };
  30.  
  31.     but don't use the above example, it does not work(at least not over
  32. here)... Wow, what kind of books are you reading?
  33.  
  34. --
  35. Steve
  36.